<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>126-scroll相关取值.html</title>
	<style>
		*{
			margin: 0;
			padding: 0;
		}
		body{
			width: 3000px;
			height: 3000px;
		}
	</style>
</head>
<body>
	
</body>
<script>
	console.log("document.body.scrollTop::",document.body.scrollTop);
	console.log("document.body.scrollLeft::",document.body.scrollLeft);
	console.log("document.body.scrollWidth::",document.body.scrollWidth);
	console.log("document.body.scrollHeight::",document.body.scrollHeight);

	var iScrollTop = 0,iScrollLeft = 0;
	/*
	if(document.compatMode == 'CSS1Compat'){
		iScrollTop = document.documentElement.scrollTop;
		iScrollLeft = document.documentElement.scrollLeft;
	}else{
		iScrollTop = document.body.scrollTop;

		iScrollLeft = document.body.scrollLeft;

	}
	*/
	console.log("window.pageXOffset::",window.pageXOffset);
	console.log("window.pageYOffset::",window.pageYOffset);
	iScrollTop = window.pageXOffset|| document.
	documentElement.scrollTop || document.body.scrollTop;

		
	iScrollTop = window.pageYOffset|| document.
	documentElement.scrollLeft || document.body.scrollLeft;
	console.log(iScrollTop,iScrollLeft);
</script>
</html>